The disclosures herein relate generally to pumps and in particular to a method and system for detecting cavitation in a pump. Often, there is a need for detecting cavitation in a pump, such as a positive displacement pump. However, previous techniques for detecting cavitation in a pump have various shortcomings. Thus, a need has arisen for a method and system for detecting cavitation in a pump, in which various shortcomings of previous techniques are overcome.